package com.cr.admin.business.vehicle.service.impl;

import com.cr.admin.business.topic.pojo.entity.Topic;
import com.cr.admin.business.vehicle.dao.repository.VehicleRepository;
import com.cr.admin.business.vehicle.pojo.entity.Vehicle;
import com.cr.admin.business.vehicle.pojo.param.VehicleAddParam;
import com.cr.admin.business.vehicle.pojo.param.VehicleUpdateParam;
import com.cr.admin.business.vehicle.pojo.query.Query;
import com.cr.admin.business.vehicle.pojo.query.VehicleQuery;
import com.cr.admin.business.vehicle.pojo.vo.VehicleVO;
import com.cr.admin.business.vehicle.service.VehicleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

@Service
public class VehicleServiceImpl implements VehicleService {

    @Autowired
    private VehicleRepository vehicleRepository;


    @Override
    public List<Vehicle> list(VehicleQuery vehicleQuery) {
        return vehicleRepository.selectList(vehicleQuery);
    }

    @Override
    public void insert(VehicleAddParam vehicleAddParam) {
        vehicleRepository.insert(vehicleAddParam);
    }

    @Override
    public void deleteByIds(List<Long> ids) {
        vehicleRepository.deleteByIds(ids);
    }

    @Override
    public void updateById(VehicleUpdateParam vehicleUpdateParam) {
        vehicleRepository.updateById(vehicleUpdateParam);
    }

    @Override
    public List<Vehicle> selectList(Query query) {
       return vehicleRepository.selectList(query);
    }

    @Override
    public VehicleVO selectById(Long id) {
        return vehicleRepository.selectById(id);
    }


}
